package com.lwj.liwanjia.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.lwj.liwanjia.R;
import com.lwj.liwanjia.bean.JieSuanBean;
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;

import java.util.List;

/**
 * Created by Administrator on 2017/9/14.
 */

public class GwcIndentListAdapter extends SuperBaseAdapter<JieSuanBean.DataBean.ShopInfoBean.GoodsBean> {
    private Context mContext;

    public GwcIndentListAdapter(Context context, List<JieSuanBean.DataBean.ShopInfoBean.GoodsBean> data) {
        super(context, data);
        mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, JieSuanBean.DataBean.ShopInfoBean.GoodsBean item, int position) {
        Glide.with(mContext).load(item.getGoodsImg()).into((ImageView) holder.getView(R.id.iv_shangpin));
        holder.setText(R.id.tv_shangpin, item.getCommodityName())
                .setText(R.id.tv_jianjie, item.getGoodsInfo())
                .setText(R.id.tv_price, "￥" + item.getNowPrice())
                .setText(R.id.tv_number, "*" + item.getAmount());
    }

    @Override
    protected int getItemViewLayoutId(int position, JieSuanBean.DataBean.ShopInfoBean.GoodsBean item) {
        return R.layout.intent_item1;
    }

}
